{!capture name='main'!}
{!include file='settings/head.tpl' showType='password'!}
{!/capture!}
{!capture name='left'!}
	<form method="post" action="/action/password_modify" onsubmit="return onSubmit(this)">
	<table cellspacing="4" cellpadding="0" border="0" width="100%">
		<tr>
			<td class="r" width="60">原密码：</td>
			<td><input type="password" name="oldPassword" style="width:200px;" maxlength="20"/><span class="g">现在使用的密码</span></td>
		</tr>
		<tr>
			<td class="r">新密码：</td>
			<td>
				<input type="password" name="password" style="width:200px;" maxlength="20"/><span class="g">6-20位</span>
			</td>
		</tr>
		<tr>
			<td class="r">密码确认：</td>
			<td>
				<input type="password" name="rePassword" style="width:200px;" maxlength="20"/><span class="g">再输一次密码</span>
			</td>
		</tr>
		<tr>
			<td></td>
			<td><input type="submit" value="修改"/></td>
		</tr>
	</table>
	</form>
{!/capture!}
{!capture name='jsCode'!}
{!if $isMyself!}
<script type="text/javascript">
function modifyNickname() {
	var _old = $('#nicknameLink').text();
	var _new = prompt("请输入新的昵称", _old);
	if (_new != null && _new != _old) {
		$.post("/action/nickname_modify", {'new':_new}, function(ret){
			if (ret == 1) {
				$('.nickname').text(_new);
			} else {
				alert(ret);
			}
		});
	}
}
function onSubmit(form){
	if (!$.trim(form.oldPassword.value)) {
		form.oldPassword.focus();
		alert("原密码不能为空");
		return false;
	}
	var len = $.trim(form.password.value).length;
	if (len < 6 || len > 20) {
		alert("密码长度为6-20位！");
		form.password.focus();
		return false;
	}
	if (form.rePassword.value != form.password.value) {
		alert("两次输入的密码不一致");
		form.password.focus();
		return false;
	}
	if ($.trim(form.oldPassword)==$.trim(form.password.value)) {
		alert("没有对密码进行任何的修改");
		return false;
	}
	return true;
}
</script>
{!/if!}
{!/capture!}

{!include file='layouts/default.tpl'!}